home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
asm
/
games
/
scanconfig
/
getconfig.s
next >
Wrap
Text File
|
1980-01-03
|
4KB
|
182 lines
*******************************************************************************
* Get Configuration
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* Obtains names and ID strings of Amiga custom chips and the CPU installed in
* the machine. It will also tell you if the Amiga is really a true NTSC or if
* it is a PAL amiga in NTSC Emulation mode...
*
* $Inputs: none
* $Outputs: a0.l = Alice/Agnus Type (APTR)
* d0.w = Alice/Agnus ID (UWORD)
*
* a1.l = Denise/Lisa Type (APTR)
* d1.w = Denise/Lisa ID (UWORD)
*
* a2.l = CPU Type (APTR) MC680x0 string
* d2.b = CPU ID (UBYTE) 0=000,1=010,2=020,3=030,4=040
*
* d3.b = PAL/NTSC ID (UBYTE) 0=PAL, 1=NTSC
*******************************************************************************
GetChipTypes: move.l 4.w,a6
lea GfxName(pc),a1 ;lib name in a1
jsr -408(a6) ;try to open library
move.l d0,a1
moveq #0,d7 ;PAL Amiga!
btst d7,207(a1) ;check for NTSC/PAL...
beq.s is_PAL
moveq #1,d7 ;NTSC Amiga!
is_PAL:
jsr -414(a6) ;close gfx library
move.l d7,-(sp) ;save NTSC/PAL Type...
move.w $DFF004,d0
and.w #$7F00,d0
lsr.w #8,d0
is_NTSC: lea AgnusValues(pc),a2
move.w d0,d5
bra.s _start
loop: move.w d5,d0
move.w (a2),d1
cmp.w d0,d1
beq.s GetChipID
addq.l #1,d7
addq.l #2,a2
_start: moveq #10,d0
cmp.l d0,d7
blt.s loop
GetChipID: moveq #0,d0
move.w $DFF07C,d0
move.l d0,d6
moveq #0,d1
not.b d1
and.l d1,d6
move.l d6,d4
moveq #0,d5
bra.s _DAE
_DA0: moveq #0,d0
move.w d4,d0
cmp.l d6,d0
beq.s _DAC
moveq #0,d4
bra.s _DB4
_DAC: addq.l #1,d5
_DAE: moveq #$10,d0
cmp.l d0,d5
blt.s _DA0
_DB4: cmp.w #$FF,d4
bne.s _DBC
moveq #0,d4
_DBC: moveq #0,d6
lea ChipIDS(pc),a2
bra.s _DCE
_DC4: move.w (a2),d0
cmp.w d4,d0
beq.s GetChipNames
addq.l #1,d6
addq.l #2,a2
_DCE: moveq #4,d0
cmp.l d0,d6
blt.s _DC4
GetChipNames: moveq #0,d0
move.w $DFF004,d0
and.l #$7F00,d0
asr.l #8,d0
moveq #0,d1
move.w $DFF07C,d1
moveq #0,d2
not.b d2
and.l d2,d1
move.l d7,d2
add.l d2,d2
move.l d6,d3
add.l d3,d3
lea AgnusTable(pc),a0
lea (a0,d2.l),a2
move.w (a2),a0
add.l a2,a0
lea ChipNames(pc),a1
lea (a1,d3.l),a2
move.w (a2),a1
add.l a2,a1
move.l (sp)+,d3 ;restore PAL/NTSC Type
movem.l d0-d1/a0-a1,-(sp)
move.l 4.w,a6
move.b AttnFlags+1(a6),d0 ;get CPU/MMU/CP Types from OS
andi.b #%00001111,d0 ;we only want CPU types..
moveq #"0",d1
findcpu: tst.b d0 ;got cpu type yet?
beq.s showcpu
lsr.b #1,d0 ;check for next type...
addq.b #1,d1 ;increase cpu type by 1
bra.s findcpu
showcpu: lea CPUType(pc),a2
move.b d1,5(a2)
sub.b #"0",d1
moveq #0,d2
move.b d1,d2
movem.l (sp)+,d0-d1/a0-a1
rts
CPUType: dc.b 'MC680x0',0 ;'x' inserted with 0,1,2,3 or 4
even
AgnusValues: dc.w $00,$10,$20,$30,$21,$31,$22,$32,$23,$33
ChipIDS: dc.w $00,$FC,$EC,$F8
GfxName: dc.b 'graphics.library',0
even
AgnusTable: dc.w NormalPALAgnu-*
dc.w NormalNTSCAgn-*
dc.w ECSPALAgnus-*
dc.w ECSNTSCAgnus-*
dc.w ECSPALAgnus-*
dc.w ECSNTSCAgnus-*
dc.w AAPALAlice-*
dc.w AANTSCAlice-*
dc.w AAPALAlice-*
dc.w AANTSCAlice-*
dc.w AAPALAlice-*
dc.w AANTSCAlice-*
dc.w AAA_PALAlice-*
dc.w AAA_NTSCAlice-*
ChipNames: dc.w NormalDenise-*
dc.w ECSDenise-*
dc.w ECSDenise-*
dc.w AALisa-*
dc.w UNKNOWN-*
NormalDenise: dc.b 'Original Denise',0
ECSDenise: dc.b 'ECS Denise',0
AALisa: dc.b 'AGA Lisa',0
UNKNOWN: dc.b 'AAA Lisa?',0
NormalPALAgnu: dc.b 'Original PAL Agnus',0
ECSPALAgnus: dc.b 'ECS PAL Agnus',0
AAPALAlice: dc.b 'AGA PAL Alice',0
AAA_PALAlice: dc.b 'AAA PAL Alice???',0
NormalNTSCAgn: dc.b 'Orignal NTSC Agnus',0
ECSNTSCAgnus: dc.b 'ECS NTSC Agnus',0
AANTSCAlice: dc.b 'AGA NTSC Alice',0
AAA_NTSCAlice: dc.b 'AAA NTSC Alice???',0
even
AttnFlags = $128